# Contributor: Luca Weiss <luca@z3ntu.xyz>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=ayatana-ido
pkgver=0.10.1
pkgrel=0
pkgdesc="Ayatana Indicator Display Objects"
url="https://github.com/AyatanaIndicators/ayatana-ido"
arch="all"
license="LGPL-2.1-only AND LGPL-3.0-only AND GPL-3.0-only"
makedepends="
	cmake
	cmake-extras
	glib-dev
	gtest-dev
	gtk+3.0-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev"
source="https://github.com/AyatanaIndicators/ayatana-ido/archive/$pkgver/ayatana-ido-$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DENABLE_TESTS=ON \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run -a ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
9804574f17830029e8789ee2c6b40f4907f527b8579751ca420fcff0017dff849585f278764f89d8c2269ef860fec3286df3e28f3ef3069c7aa5fc2dbb5f62d1  ayatana-ido-0.10.1.tar.gz
"
